﻿<phone:PhoneApplicationPage
    x:Class="DnD.GameSetupPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True"
    Style="{StaticResource TransitionPageStyle}">

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar Mode="Minimized" Opacity="0.5" IsMenuEnabled="False" IsVisible="True">

            <shell:ApplicationBarIconButton Click="AppBar_Click"   IconUri="/Assets/Icons/pin.png" Text="pin" />

        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="200"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="SET UP YOUR GAME!" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <ListBox  Grid.Row="1"  ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Disabled" ItemsSource="{Binding Decks}" SelectedItem="{Binding SelectedDeck, Mode=TwoWay}">
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Border BorderThickness="3" Width="200" Height="200" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BorderColor}">
                            <Image Source="{Binding PictureURL}"  Width="198" Height="198" Stretch="UniformToFill" />
                        </Border>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
       
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="200"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Border Grid.Row="0" BorderThickness="5" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BackgroundColor}" Margin="10,10,10,5" >
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="2*"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" TextWrapping="Wrap"  Text="{Binding SelectedDeck.Description}" Margin="10,10,10,10" Style="{StaticResource CardDescTextStyle}"/>
                    <Border Grid.Row="1" Margin="309,0,5,5" Background="{StaticResource BorderColor}"  BorderThickness="0" CornerRadius="10">
                        <toolkit:Rating  ReadOnly="True" RatingItemCount="5" Value="{Binding SelectedDeck.Rate}"  Width="125" Height="25" Background="Transparent">
                            <toolkit:Rating.FilledItemStyle>
                                <Style TargetType="toolkit:RatingItem">
                                    <Setter Property="Background" Value="White" />
                                </Style>
                            </toolkit:Rating.FilledItemStyle>
                            <toolkit:Rating.UnfilledItemStyle>
                                <Style TargetType="toolkit:RatingItem">
                                    <Setter Property="Background" Value="{StaticResource BackgroundColor}" />
                                </Style>
                            </toolkit:Rating.UnfilledItemStyle>
                        </toolkit:Rating>
                    </Border>
                </Grid>
            </Border>
            <Border Grid.Row="1" BorderThickness="5" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BackgroundColor}" Margin="10,10,10,24" >
                <StackPanel VerticalAlignment="Bottom">
                <Border Grid.Row="1"  Margin="5"  Width="150" Height="50" Background="{StaticResource BorderColor}"  BorderThickness="0" CornerRadius="10" RenderTransformOrigin="0.5,0.5">
                        <Button Command="{Binding StartGameCommand}" Content="START" HorizontalAlignment="Center"   VerticalAlignment="Center" Height="80" Width="150" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BorderColor}"></Button>

                    </Border>
                </StackPanel>
            </Border>
        </Grid>

    </Grid>

</phone:PhoneApplicationPage>